﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace TPCN.DAL
{
   public class NhanVienObj
    {
        private string _NhanvienID;

        public string NhanvienID
        {
            get { return _NhanvienID; }
            set { _NhanvienID = value; }
        }
        private string _Hovaten;

        public string Hovaten
        {
            get { return _Hovaten; }
            set { _Hovaten = value; }
        }
        private string _Email;

        public string Email
        {
            get { return _Email; }
            set { _Email = value; }
        }
        private string _Username;

        public string Username
        {
            get { return _Username; }
            set { _Username = value; }
        }
        private string _Password;

        public string Password
        {
            get { return _Password; }
            set { _Password = value; }
        }
        private string _IsAdmin;

        public string IsAdmin
        {
            get { return _IsAdmin; }
            set { _IsAdmin = value; }
        }
        private string _Active;

        public string Active
        {
            get { return _Active; }
            set { _Active = value; }
        }
       
        public NhanVienObj SetValuesFromDataReader(IDataReader reader)
        {
            NhanVienObj obj = new NhanVienObj();
            obj.NhanvienID = (reader["NhanvienID"] is DBNull) ? String.Empty : reader["NhanvienID"].ToString();
            obj.Hovaten = (reader["Hovaten"] is DBNull) ? String.Empty : reader["Hovaten"].ToString();
            obj.Email = (reader["Email"] is DBNull) ? String.Empty : reader["Email"].ToString();
            obj.Username = (reader["Username"] is DBNull) ? String.Empty : reader["Username"].ToString();
            obj.Password = (reader["Password"] is DBNull) ? String.Empty : reader["Password"].ToString();
            obj.IsAdmin = (reader["IsAdmin"] is DBNull) ? String.Empty : reader["IsAdmin"].ToString();
            obj.Active = (reader["Active"] is DBNull) ? String.Empty : reader["Active"].ToString();
            return obj;
        }
    }
}
